﻿@using BootstrapBlazor.Components
@inherits LayoutComponentBase

<Layout SideWidth=0 IsPage=true IsAccordion=true IsFixedHeader=true IsFullSide=true ShowFooter=true ShowCollapseBar=true UseTabSet=true
        TabDefaultUrl="/Admin/Index" Menus=@menuItems OnAuthorizing=OnAuthorizing OnUpdateAsync=OnUpdateAsync
        AdditionalAssemblies="new[]{ typeof(BlazorAdmin.Web.Shared._Imports).Assembly, typeof(Pangeo.Admin.Web.Shared._Imports).Assembly }">
    <Header>
        <span class="ms-3 flex-fill">@AppInfo.CnName</span>
        <Logout ImageUrl=@currentUser.Icon DisplayName="@currentUser.DisplayName" UserName="@currentUser.UserName">
            <LinkTemplate>
                <a href="/Admin/Profiles"><i class="fa-solid fa-suitcase"></i>个人中心</a>
                <a href="/Admin/Index"><i class="fa-solid fa-cog"></i>设置</a>
                <a href="/Admin/Notifications">
                    <i class="fa-solid fa-bell"></i>通知<span id="logoutNoti" class="badge badge-pill badge-success"></span>
                </a>
                <a href="/" @onclick=OnLogout><i class="fa fa-key"></i>注销</a>
            </LinkTemplate>
        </Logout>
        <div class="layout-drawer"><i class="fa-solid fa-gears"></i></div>
    </Header>
    <Side>
        <div class="layout-banner">
            <div class="logo"></div>
            <div class="text">H R M</div>
        </div>
        <div class="layout-user">
            <img class="layout-avatar" src=@currentUser.Icon>
            <div class="layout-title">
                <span>@currentUser.DisplayName</span>
            </div>
        </div>
    </Side>
    <Main>
        @Body
    </Main>
    <!--<Footer>
        <div class="flex-fill text-center">@webFooter</div>
    </Footer>-->
</Layout>

@if (AppIsLock)
{
    <AutoRedirect LogoutUrl="/Account/Logout" Interval="@LockInterval"></AutoRedirect>
}
